#region Microsoft Public License
/*
 * (c) Copyright Chenjun Wu. http://utablesdk.codeplex.com
 * 
 * This source is subject to the Microsoft Public License (Ms-PL).
 * Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
 * All other rights reserved.
 */
#endregion

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UTable.Config
{
    public class ConfigGenerator
    {
        public static UTableConfig GetConfigFromXml(String filePath)
        {
            return ObjectXMLSerializer<UTableConfig>.Load(filePath);
        }

        public static UTableConfig GetDefaultConifg()
        {
            UTableConfig config = new UTableConfig();
            config.Debug = true;
            config.MultiThread = true;
            config.Window = new WindowConfig();
            config.Window.Maximized = true;

            config.Tabletop = new TabletopConfig();
            config.Tabletop.Class = new ClassConfig();
            config.Tabletop.Class.Type = "UTable.Objects.UMeeting";
            config.Tabletop.Class.Assembly = "UTable.Objects";

            config.Input = new InputConfig();
            InstanceConfig multiMice = new InstanceConfig();
            multiMice.Class = new ClassConfig();
            multiMice.Class.Type = "UTable.Input.MultiMouseProvider";
            multiMice.Class.Assembly = "UTable.Input";
            config.Input.Providers = new List<InstanceConfig>();
            config.Input.Providers.Add(multiMice);
            InstanceConfig tuio = new InstanceConfig();
            tuio.Class = new ClassConfig();
            tuio.Class.Type = "UTable.Input.TuioProvider";
            tuio.Class.Assembly = "UTable.Input";
            config.Input.Providers.Add(tuio);

            return config;
        }
    }
}
